/**
 * 
 */
package cen5501c.common;

import java.util.List;

/**
 * Represents the parent of all command classes.
 * 
 * @author Jiangyan Xu
 */
public abstract class CmdBase {
	/**
	 * Returns the name (operation) of the command. Derived classes should
	 * return their OPERATION field.
	 */
	public abstract String getOperation();

	/**
	 * Returns the list of arguments in String format in the order specified by
	 * the protocol.
	 * 
	 * @return the list
	 */
	public abstract List<String> getArgList();

	/**
	 * Assign the object's instance variables
	 * 
	 * @param args
	 * @throws Exception
	 *             if input String typed args are invalid
	 */
	protected abstract void fillArgs(List<String> args) throws Exception;

	public CmdBase() {
	}

	public CmdBase(List<String> args) throws Exception {
		fillArgs(args);
	}
}
